FROM openjdk:11-jdk
#FROM openjdk:11.0.11-jdk-slim

LABEL maintainer=snowing

#docker run -e PARAMS="--server.port 9090"
ENV PARAMS="--server.port=8080 --spring.profiles.active=prod --spring.cloud.nacos.discovery.server-addr=172.16.122.1:8848 --spring.cloud.nacos.config.server-addr=172.16.122.1:8848 --spring.cloud.nacos.config.namespace=7ddba4e0-a7ca-4c70-922a-20ac99a8f376 --spring.cloud.nacos.config.file-extension=yml"
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone

# 挂载目录
VOLUME /home/ruoyi
# 创建目录
RUN mkdir -p /home/ruoyi
# 指定路径
WORKDIR /home/ruoyi
# 复制jar文件到路径
COPY target/*.jar /home/ruoyi/app.jar
EXPOSE 8080

#
ENTRYPOINT ["/bin/sh","-c","java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar app.jar ${PARAMS}"]